// 处理路径的工具模块

const path = require("path");

// console.log(path)

// windows：D:\Users\liyang\Desktop\sh2305\day30
// MAC：/Users/liyang/Desktop/sh2305/day30

const a = "desktop";
const b = "sh2305";
const c = "day30";
const d = "index.html";

// 自动根据当前操作系统的类型，拼接处对应的路径
console.log( path.join( "liyang", a, b, c, d ) );

// /Users/liyang/Desktop/sh2305/day30
console.log( __dirname );

// /Users/liyang/Desktop/sh2305/day30/6path.js
console.log( __filename );

// 获取一些文件夹的绝对路径
console.log(path.join( __dirname, "..", "day03", "11挑错技巧.html" ));